<?php
/*****************************************************
 函数名称：dh_say_ajax_action_do
 函数作用：动态加载随机名人名言
 函数作者：DH
 作者地址：http://dhblog.org
******************************************************/

function dh_say_ajax_action_do(){
	if( isset($_POST['action'])&& $_POST['action'] == 'dh_say_ajax'){
		echo dh_say();
		die();
	}else{
		return;
	}
}
add_action('template_redirect', 'dh_say_ajax_action_do');

function dh_say(){
	$words = explode("\n",stripslashes(get_theme_mod('dh_say_content')));
	$word = $words[ mt_rand(0, count($words) - 1) ];
	echo $word;
	echo 'mm';
}
?>